$(document).ready(function() {
 var option = $.cookie('option');
 if (option != null)
  $('#options').val(option);
 var queries = [];
 queries['dir-addurl'] = '"add url"';
 queries['dir-addsite'] = '"add site"';
 queries['dir-addwebsite'] = '"add website"';
 queries['ac.id-backlinks'] = 'intext:Next > | Last >> Isi Komentar site:ac.id';
 queries['go.id-backlinks'] = 'intext:Next > | Last >> Isi Komentar site:go.id';
 queries['ac.id-guestbook'] = 'intext:Next > | Last >> guestbook site:ac.id';
 queries['go.id-guestbook'] = 'intext:Next > | Last >> guestbook site:go.id';
 queries['or.jp-guestbook'] = '/g_book/g_book.cgi site:.or.jp';
 queries['edu-backlinks'] = 'site:.edu inurl:guestbook';
 queries['gov-backlinks'] = 'site:.gov inurl:guestbook';
 queries['bravejournal-backlinks'] = 'intext:Posted by site:.bravejournal.com';
 queries['keywordluv'] = '"Enter YourName@YourKeywords"';
 queries['do-follow-comments'] = '"Notify me of follow-up comments?"+"Submit the word you see below:"';
 queries['squidoo-addtolist'] = '"add+to+this+list" site:squidoo.com';
 queries['hubpages'] = 'site:hubpages.com "hot hubs"';
 queries['bravenet-backlinks'] = 'inurl:guestbook site:.bravenet.com';
 queries['pic-comments'] = 'Please enter the letters that are shown in the picture below (without spaces, and upper or lower case can be used). If you cannot identify the captcha even after reloading it please contact the administrator of this site.';
 queries['guestbook-comments'] = 'Thank you for visiting my site. Here you can leave your comments.';
 queries['expression-engine'] = '"powered by expressionengine"';
 queries['blog-engine'] = '"Powered by BlogEngine.NET" inurl:blog "post a comment" -"comments closed" -"you must be logged in"';
 queries['comment-luv-premium'] = '"This blog uses premium CommentLuv" -"The version of CommentLuv on this site is no longer supported."';
 queries['livefyre'] = '"get livefyre" "comment help" -"Comments have been disabled for this post"';
 queries['intensedebate'] = '"if you have a website, link to it here" "post a new comment"';
 
 $('#keyword').focus(); 
 $('#keyword').keypress(function(e) {
  if (e.which == 13) {
   doSearch();
  }
 });
  
 $('#search').click(function() {
  doSearch();
 });
 
 function doSearch() {
  var kw = $('#keyword').val();
  var option = $('#options').val();
  var query = escape(queries[option]);
  window.open("http://www.google.com/search?q="+kw+"+"+query);
  $.cookie('option', option);
 }
});


